<?php


use Sc\Util\HtmlStructure\Form;
use Sc\Util\HtmlStructure\Html\Html;

Html::create('表单-文本输入型');

$form = Form::create("demo12Form")->config(['label-width' => '80px']);

$form->addFormItems(
    Form\FormItem::text('name', '姓名')->prefix('User', true)->requiredVerify()->col(8),
    Form\FormItem::text('phone', '手机号')->requiredVerify()->placeholder('请输入手机号')->col(8, 8),
    Form\FormItem::text('email', '邮箱')->suffix('Document', true)->col(8),
    Form\FormItem::customize("请输入有效的邮箱")->col(16),
    Form\FormItem::text('password', '密码')->prefix('Lock', true)->toPassword()->col(8, 16/** 这里表示后面补上16格的空间 */),
    Form\FormItem::text('age', '年龄')->toNumber()->col(8),
    Form\FormItem::customize("这个只能输入数字")->col(16),
    Form\FormItem::textarea('intro', '简介'),
    Form\FormItem::customize("默认富文本为 froala , 也可以安装 UEditorPlus 插件使用 UEditorPlus 富文本",)->setLabel('富文本'),
    Form\FormItem::editor('intros', '经历'),
);

return $form->render();
